package com.huluobo.high3videoproject.db;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.huluobo.high3videoproject.bean.UserInfo;
import com.huluobo.high3videoproject.bean.UserMoney;

import com.huluobo.high3videoproject.db.UserInfoDao;
import com.huluobo.high3videoproject.db.UserMoneyDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig userInfoDaoConfig;
    private final DaoConfig userMoneyDaoConfig;

    private final UserInfoDao userInfoDao;
    private final UserMoneyDao userMoneyDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        userInfoDaoConfig = daoConfigMap.get(UserInfoDao.class).clone();
        userInfoDaoConfig.initIdentityScope(type);

        userMoneyDaoConfig = daoConfigMap.get(UserMoneyDao.class).clone();
        userMoneyDaoConfig.initIdentityScope(type);

        userInfoDao = new UserInfoDao(userInfoDaoConfig, this);
        userMoneyDao = new UserMoneyDao(userMoneyDaoConfig, this);

        registerDao(UserInfo.class, userInfoDao);
        registerDao(UserMoney.class, userMoneyDao);
    }
    
    public void clear() {
        userInfoDaoConfig.clearIdentityScope();
        userMoneyDaoConfig.clearIdentityScope();
    }

    public UserInfoDao getUserInfoDao() {
        return userInfoDao;
    }

    public UserMoneyDao getUserMoneyDao() {
        return userMoneyDao;
    }

}
